package com.hxx.common.core.wcontour.enums;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * 气象雷达颜色对应枚举
 *
 * @author 李刚
 */
public enum RadarColorEnum {
    /**
     * V_为前缀,后面是值
     */
    VF_9999(-9999.0, "#FFFFFF"),
    V_0(0.0, "#FFFFFF"),
    V_1(1.0, "#FFFFFF"),
    V_2(10.0, "#0000FF"),
    V_3(16.0, "#0000C7"),
    V_4(16.5, "#00007F"),
    V_5(17.0, "#003D38"),
    V_6(17.5, "#008600"),
    V_7(18.0, "#00D100"),
    V_8(18.5, "#00FF00"),
    V_9(23.5, "#00FD00"),
    V_10(24.0, "#00EF00"),
    V_11(24.5, "#00ED00"),
    V_12(25.0, "#00EB00"),
    V_13(25.5, "#00DA00"),
    V_14(26.0, "#00CA00"),
    V_15(26.5, "#00B900"),
    V_16(27.0, "#00A900"),
    V_17(27.5, "#009800"),
    V_18(28.0, "#008800"),
    V_19(28.5, "#007800"),
    V_20(29.0, "#006700"),
    V_21(30.5, "#008600"),
    V_22(31.0, "#00A700"),
    V_23(31.5, "#00C500"),
    V_24(32.0, "#3DE600"),
    V_25(32.5, "#86FF00"),
    V_26(33.0, "#D1FF00"),
    V_27(33.5, "#FFFF00"),
    V_28(38.5, "#FFED00"),
    V_29(39.0, "#FFDD00"),
    V_30(39.5, "#FFDA00"),
    V_31(40.0, "#FFD800"),
    V_32(40.5, "#FFCA00"),
    V_33(41.0, "#FFBC00"),
    V_34(41.5, "#FFAE00"),
    V_35(42.0, "#FFA000"),
    V_36(42.5, "#FF9100"),
    V_37(43.0, "#FF8300"),
    V_38(43.5, "#FF7500"),
    V_39(44.0, "#FF6700"),
    V_40(45.5, "#FF3D00"),
    V_41(46.0, "#FF1300"),
    V_42(46.5, "#FF0000"),
    V_43(52.5, "#E80000"),
    V_44(53.0, "#CE0000"),
    V_45(53.5, "#B50000"),
    V_46(54.0, "#9B0000"),
    V_47(55.5, "#880000"),
    V_48(56.0, "#750000"),
    V_49(56.5, "#630000"),
    V_50(57.0, "#500000"),
    V_51(57.5, "#3D0000"),
    V_52(58.0, "#2A0000"),
    V_53(58.5, "#170000"),
    V_54(59.0, "#050000"),
    V_55(59.5, "#020000"),
    V_56(60.0, "#000000"),
    V_57(60.5, "#2D0000"),
    V_58(61.0, "#590000"),
    V_59(61.5, "#860000"),
    V_60(62.0, "#B2003D"),
    V_61(62.5, "#DF0086"),
    V_62(63.0, "#FF00D1"),
    V_63(63.5, "#FF00FF"),
    V_64(67.0, "#F400FF"),
    V_65(67.5, "#D500FF"),
    V_66(68.0, "#B900FF"),
    V_67(68.5, "#9B00FD"),
    V_68(69.0, "#7F00EF"),
    V_69(69.5, "#7C00ED"),
    V_70(70.0, "#7A00EB"),
    V_71(70.5, "#960CF9"),
    V_72(71.0, "#B53DFF"),
    V_73(71.5, "#D16EFF"),
    V_74(72.0, "#EFA0FF"),
    V_75(72.5, "#FFD1FF"),
    V_76(73.0, "#FFFFFF"),
    V_9999(9999.0, "#FFFFFF");


    RadarColorEnum(double value, String color) {
        this.value = value;
        this.color = color;
    }

    /**
     * 值
     */
    private double value;

    /**
     * 雷达值对应颜色
     */
    private String color;

    public double getValue() {
        return value;
    }

    public String getColor() {
        return color;
    }

    /**
     * 值数组
     *
     * @return
     */
    public static double[] getValueArray() {
        int length = RadarColorEnum.values().length;
        double[] valueArray = new double[length];
        int i = 0;
        for (RadarColorEnum anEnum : RadarColorEnum.values()) {
            valueArray[i++] = anEnum.value;
        }
        return valueArray;
    }

    public static Map<Double, String> getValueColorMap() {
        Map<Double, String> map = new LinkedHashMap<>();
        for (RadarColorEnum anEnum : RadarColorEnum.values()) {
            map.put(anEnum.getValue(), anEnum.getColor());
        }
        return map;
    }
}
